#ifndef LEVELH
#define LEVELH

#include <string>
#include <map>
#include <list>
#include "PlayerList.h"


class Level
{
public:
    struct Link
    {
        std::string m_nextMap,
                    m_nextX,
                    m_nextY;

        int m_x, m_y, m_width, m_height;

        //std::string GetSendData() const {
        //    return nextMap + " " + StringConversion(x) + " " + StringConversion(y) + " " + StringConversion(width) + " " +
        //        StringConversion(height) + " " + nextX + " " + nextY;
        //}
    };

    struct Sign
    {
        int m_x, m_y;
        std::string m_text;
        //ByteStream GetSendData() const {
        //    return ByteStream(PacketInt1(x)) << PacketInt1(y) << text;
        //}
    };

private:
    //Level elements
    std::list<Link> m_links;
    std::list<Sign> m_signs;

    GMPlayerList  m_players;
    std::string m_levelName;
    std::string m_fileName;

    //Tile data
    short   m_tiles[64 * 64];

    //Player leaving times
    std::map<GMPlayer*, unsigned int> m_leavingTimes;

public:
    Level(gmMachine* machine, const std::string& levelName, const std::string& fileName):
        m_players(machine), m_levelName(levelName), m_fileName(fileName){}

    void AddPlayer(int playerID, GMPlayer* player);
    void RemovePlayer(int playerID);
};

#endif // LEVELH

